<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnReviewStatusInDelayOrderTaskTable extends AbstractMigration
{
    public function up()
    {
        $this->table('delay_order_task')
            ->addColumn('confirm_status', 'enum', [
                'null' => false,
                'values' => 'step_category_confirming,producer_confirming,yes,no',
                'default' => 'step_category_confirming',
                'comment' => '确认状态进度',
            ])
            ->addColumn('confirming_step_category_id', 'integer', [
                'null' => false,
                'default' => 0,
                'limit' => 11,
                'comment' => '确认中环节id',
            ])
            ->save();
    }

    public function down()
    {
        $this->table('delay_order_task')
            ->removeColumn('confirm_status')
            ->removeColumn('confirming_step_category_id')
            ->save();
    }
}
